package visitor.car;

public class Car implements CarElement {

	private CarElement[] elements;

	public Car() {
		this.elements = new CarElement[] { new Wheel("front left"),
				new Wheel("front right"), new Wheel("back left"),
				new Wheel("back right"), new Body(), new Engine() };
	}

	@Override
	public void accept(CarElementVistor vistor) {
		for (CarElement element: elements)	{
			element.accept(vistor);
		}
		
		vistor.vist(this);
	}
}
